<html>
<body>
<p>Test opera W3C test suite(http://w3c-test.org/webappsec/tests/cors/submitted/opera/staging/redirect-origin.htm) test case 13 for redirection.<br>
Request URL origin is not same origin with the original URL origin. Final response contains "Access-Control-Allow-Origin: null". Should print PASS.</p>
<div id="log"></div>
<script>
function log(message) {
    document.getElementById("log").innerHTML += message + "<br>";
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

var xhr = new XMLHttpRequest();
xhr.open("GET", "http://localhost:8080/xmlhttprequest/resources/redirect-cors-origin-null.php");
xhr.onerror = function () {
    log("FAIL");
    if (window.testRunner)
        testRunner.notifyDone();
};
xhr.onreadystatechange = function () {
    if (xhr.readyState == 4) {
        log(xhr.responseText);
        if (window.testRunner)
            testRunner.notifyDone();
    }
};
xhr.send();

</script>
</html>
